package development;

import state.AlertMenu;
import state.GameGlobal;
import state.component.MenuStyle;
import state.component.Style;
import state.component.TextFieldStyle;
import state.font.FontManager;
import state.util.Color;

public abstract class Global extends GameGlobal {
	public static MenuStyle MENU_STYLE;
	public static Style CHECK_BOX_STYLE;
	public static TextFieldStyle TEXT_FIELD_STYLE;
	public static Style ALERT_MENU_STYLE;
	
	/**
	 * Init all data here
	 */
	public static void init() {
	  initCheckboxStyle();
	  initMenuStyle();
	  initTextFieldStyle();
	  initAlertMenuStyle();
	}
	
	private static void initCheckboxStyle() {
	  CHECK_BOX_STYLE = new Style();
	  CHECK_BOX_STYLE.setHasBorder(true);
	  CHECK_BOX_STYLE.setBorderColor(Color.RED2_CODE);
	  
	  CHECK_BOX_STYLE.setFocusable(true);
	  CHECK_BOX_STYLE.setForceGroundColor(Color.BLACK_CODE);
	  CHECK_BOX_STYLE.setFocusFgColor(Color.WHITE_CODE);
	  
	  CHECK_BOX_STYLE.setFillBackGround(true);
	  CHECK_BOX_STYLE.setBackgroundColor(Color.WHITE_CODE);
	  CHECK_BOX_STYLE.setFocusBgColor(Color.GREEN_CODE);
	}
	
	private static void initMenuStyle() {
    MENU_STYLE = new MenuStyle();
    MENU_STYLE.setFillBackGround(false);
    MENU_STYLE.setFillFocusItemBg(true);
    MENU_STYLE.setFocusBgColor(0xA53A06);
    MENU_STYLE.setForceGroundColor(Color.WHITE_CODE);
    MENU_STYLE.setFocusFgColor(Color.WHITE_CODE);
    MENU_STYLE.setHasBorder(false);
    MENU_STYLE.setItemHeight(18);
    MENU_STYLE.setItemWidth(116);
    MENU_STYLE.setFont(FontManager.getFont(FontManager.FONT_SIZE_8));
    MENU_STYLE.setTextDx(5);
    MENU_STYLE.setTextDy(2);
  }
  
  private static void initTextFieldStyle() {
    TEXT_FIELD_STYLE = new TextFieldStyle();
    TEXT_FIELD_STYLE.setFillBackGround(true);
    TEXT_FIELD_STYLE.setBackgroundColor(Color.WHITE_CODE);
    TEXT_FIELD_STYLE.setHasBorder(false);
    TEXT_FIELD_STYLE.setForceGroundColor(Color.BLACK_CODE);
    TEXT_FIELD_STYLE.setFont(FontManager.getFont(FontManager.FONT_SIZE_11));
    TEXT_FIELD_STYLE.setAlign(TextFieldStyle.ALIGN_LEFT);
    TEXT_FIELD_STYLE.setFocusable(true);
    TEXT_FIELD_STYLE.setFocusBgColor(0xFDFBB7);
    TEXT_FIELD_STYLE.setFocusFgColor(Color.BLACK_CODE);
  }
  
  private static void initAlertMenuStyle() {
    ALERT_MENU_STYLE = new Style();
    ALERT_MENU_STYLE.setBackgroundColor(0xD0A736);
    ALERT_MENU_STYLE.setBorderColor(Color.WHITE_CODE);
    ALERT_MENU_STYLE.setForceGroundColor(Color.WHITE_CODE);
    ALERT_MENU_STYLE.setFocusFgColor(0x7F0300);
    ALERT_MENU_STYLE.setFocusBgColor(Color.GREEN_CODE);
    ALERT_MENU_STYLE.setFont(FontManager.getFont(FontManager.FONT_SIZE_8));
    AlertMenu.setStyle(ALERT_MENU_STYLE);
  }
}
